Skip to content

fix: respect CLAUDE_CODE_DISABLE_TERMINAL_TITLE in UserPromptSubmit hook#33

Open
Saradhii wants to merge 1 commit into
warpdotdev:mainfrom
Saradhii:respect-disable-terminal-title
Open

fix: respect CLAUDE_CODE_DISABLE_TERMINAL_TITLE in UserPromptSubmit hook#33
Saradhii wants to merge 1 commit into
warpdotdev:mainfrom
Saradhii:respect-disable-terminal-title

Conversation

@Saradhii
Copy link
Copy Markdown

Summary

  • Respects the CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 environment variable in the UserPromptSubmit hook
  • When set, omits the query field from the prompt_submit payload so Warp does not overwrite the user's custom tab title
  • The notification still fires for session status transitions (idle → running), only the title text is suppressed
  • Adds 3 new tests covering the behavior

Problem

Users who set CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 to opt out of terminal title updates still had their tab title overwritten by the plugin's UserPromptSubmit hook, because the env var was not checked before sending the prompt text to Warp.

Changes

  • on-prompt-submit.sh: Check CLAUDE_CODE_DISABLE_TERMINAL_TITLE after extracting the query. If set to 1, clear the query and conditionally build the payload args so the query field is entirely omitted (not just empty string).
  • test-hooks.sh: Add tests verifying query is present without the env var, query is absent with CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1, and the event type is still prompt_submit.

Test plan

  • All 42 tests pass (39 existing + 3 new)
  • bash plugins/warp/tests/test-hooks.sh — 0 failures

Fixes #24

When CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 is set, omit the query field
from the prompt_submit payload so Warp does not overwrite the user's
tab title. The notification still fires for session status transitions.

Fixes warpdotdev#24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Respect CLAUDE_CODE_DISABLE_TERMINAL_TITLE in UserPromptSubmit hook

1 participant